<template>
  <el-dropdown v-if="devMode" @command="executeCommand" :show-timeout="showTimeout" @visible-change="visibleChange">
    <span>
      <span>{{prop.name}}</span>
    </span>
    <el-dropdown-menu slot="dropdown">
      <rva-dropdown-configproperty :prop="prop" command="configProperty" :execute-command="command"
                                   @rva-button-click="handleFormButtonClick"/>
      <rva-dropdown-cloneproperty :prop="prop" command="cloneProperty" :execute-command="command"
                                  @rva-button-click="handleFormButtonClick"/>
      <el-dropdown-item command="deleteProperty" style="color: #f56c6c"><span class="el-icon-delete"></span> 删除属性
      </el-dropdown-item>
      <rva-dropdown-dictionary :prop="prop" command="configDict" :execute-command="command"
                               @rva-button-click="handleFormButtonClick"/>
      <el-dropdown-item v-if="prop.dictType" command="deleteDict" style="color: #F56C6C"><span
        class="el-icon-notebook-2"></span> 删除字典
      </el-dropdown-item>
      <rva-dropdown-relatedcrud :prop="prop" command="showRelatedCrud" :execute-command="command"
                                @rva-button-click="handleFormButtonClick"/>
      <rva-dropdown-synchronize :prop="prop" @rva-button-click="handleFormButtonClick"/>
    </el-dropdown-menu>
  </el-dropdown>
  <span v-else>{{prop.name}}</span>
</template>

<script>

import config from '@/api/rva/config'
import RvaDropdownDictionary from "@/components/rva/config/dropdown/property/dictionary";
import RvaDropdownConfigproperty from "@/components/rva/config/dropdown/property/configproperty";
import RvaDropdownCloneproperty from "@/components/rva/config/dropdown/property/cloneproperty";
import RvaDropdownRelatedcrud from "@/components/rva/config/dropdown/property/relatedcrud";
import RvaDropdownSynchronize from "@/components/rva/config/dropdown/property/synchronize";

export default {
  mixins: [config],
  components: {RvaDropdownDictionary, RvaDropdownConfigproperty, RvaDropdownCloneproperty, RvaDropdownRelatedcrud, RvaDropdownSynchronize},
};
</script>
